package oop;

public class SalesEmployee extends Employee{
    private double monlysales;
    private double commisionrate;
    public SalesEmployee(String name,int birthmonth,double monlysales,double commisionrate){
        super(name,birthmonth);
        this.monlysales=monlysales;
        this.commisionrate=commisionrate;
    }
    public double getMonlysales(){
        return monlysales;
    }
    public double setMonlysales(double monlysales){
        this.monlysales=monlysales;
        return monlysales;
    }
    public double getCommisionrate(){
        return commisionrate;
    }
    public double setCommisionrate(double commisionrate){
        this.commisionrate=commisionrate;
        return commisionrate;
    }
    @Override
    public double getSalary(int month){
        double salary=monlysales*commisionrate;
        if(month==getBirthmonth()){
            salary+=100;
        }
        return salary;
    }
}
